package com.itheima.crm.service;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import com.itheima.common.utils.Page;
import com.itheima.crm.mapper.RiZhiDao;

import com.itheima.crm.pojo.RiZhi;


/**
 * 客户管理
 * 
 * @author lx
 *
 */
@Service
public class RiZhiServiceImpl implements RiZhiService {

	
	@Autowired
	private RiZhiDao yuangongdao;

	@Override
	public Page<RiZhi> selectApplicationList(RiZhi vo) {
		Page<RiZhi> page = new Page<RiZhi>();
		// 每页数
		page.setSize(5);
		vo.setSize(5);
		if (null != vo) {
			// 判断当前页
			if (null != vo.getPage()) {
				page.setPage(vo.getPage());
				vo.setStartRow((vo.getPage() - 1) * vo.getSize());
			}

			// 总条数
			page.setTotal(yuangongdao.RiZhiCount(vo));
			
			page.setRows(yuangongdao.selectRiZhiList(vo));
		}
		return page;
	}



	@Override
	public void insertApplication(RiZhi vo) {
		yuangongdao.insert(vo);
		
	}
		     
	

	



	




}
